<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2021/5/19
  Time: 15:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/common/common.jsp" %>
<html>
<head>
    <title>Title</title>
    <SCRIPT>
        function login1() {
            $.ajax({
                url: "<%=path%>/user/denglu",
                data: $("#loginForm").serialize(),
                dataType: "json",
                type: "post",
                async: true,
                success: function (rs) {
                    if (rs.chil == true) {
                        alert("登录成功");
                        location.href = "<%=path%>/treeview.jsp"
                    } else{
                            alert(rs.message);
                    }

                        },
                error: function (rs) {
                    console.log(rs);
                    alert("网络异常请刷新")
                }

            })
        }


        function zhuche() {
            location.href = "<%=path%>/user/zhuche";

        }
    </SCRIPT>
</head>
<body>

<div class="container-fluid">
    <div class="panel panel-primary" style="width:400px">
        <div class="panel-heading">
            <h1>登录</h1>
        </div>
        <div class="panel-body">
            <form id="loginForm">
                <div class="form-group">
                    <label for="uname">账号</label>
                    <input type="text" class="form-control" name="uname" id="uname" placeholder="请输入账号">
                    <div id="tips"></div>
                </div>
                <div class="form-group">
                    <label for="password">密码</label>
                    <input type="password" class="form-control" name="password" id="password">
                </div>

                <input type="button" class="btn btn-success btn-lg" value="登录" onclick="login1()">
                <input type="button" class="btn btn-success btn-lg" value="注册" onclick="zhuche()">
            </form>
        </div>
    </div>
</div>
</body>
</html>
